import urllib.request



def imageCrawler(url, toPath):
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
    }
    req = urllib.request.Request(url, headers=headers)
    response = urllib.request.urlopen(req)
    HtmlStr = response.read()
    with open(r"F:\image\taobao.html", "wb") as f:
        f.write(HtmlStr)

    #pat = r""

url = "https://list.tmall.com/search_product.htm?spm=875.7931836/B.subpannel2016025.3.37604265feWINp&q=%C1%AC%D2%C2%C8%B9&pos=3&from=.list.pc_1_searchbutton&acm=2016031463.1003.2.1398732&type=p&scm=1003.2.2016031463.OTHER_1548471519566_1398732"
toPath = r"F:\image"
imageCrawler(url, toPath)